package yh.design.common.res;

import java.io.Serializable;

/**
 * @author: zyh
 * @date: 2025/4/12 23:08
 **/
public class APIResult<T> implements Serializable {



    public static final Integer SUCCESS = 200;

    public static final Integer FAIL = 203;

    private Integer code;

    private String msg;

    private T body;



    public static <T>  APIResult<T> success(){
        return new APIResult<>(SUCCESS,"成功",null);
    }

    public APIResult() {
    }

    public APIResult(Integer code, String msg, T body) {
        this.code = code;
        this.msg = msg;
        this.body = body;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getBody() {
        return body;
    }

    public void setBody(T body) {
        this.body = body;
    }



}
